#import "BBBackgroundView.h"

@implementation BBBackgroundView

- (void)drawRect:(NSRect)rect {
  rect = [self bounds];
  
  NSBezierPath *roundRect = [NSBezierPath bezierPath];
  
  [roundRect appendBezierPathWithRoundedRectangle:rect withRadius:8];
  [roundRect addClip];
  
  BOOL darkMode = [[NSUserDefaults standardUserDefaults] boolForKey:@"QSFlatBezelDarkMode"];
  if (darkMode) {
      [[NSColor colorWithRed:.1 green:.1 blue:.1 alpha:.99] set];
  } else {
      [[NSColor colorWithRed:1 green:1 blue:1 alpha:.99] set];
  }
  NSRectFill(rect);

  [super drawRect:rect];
}

@end
